
local skill = fk.CreateSkill {
  name = "lvshi__yanzheng_buff&",
}

skill:addEffect("viewas", {
  anim_type = "control",
  pattern = "nullification",
  handly_pile = true,
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select).type == Card.TypeEquip
  end,
  view_as = function(self, player, cards)
    if #cards ~= 1 then return end
    local card = Fk:cloneCard("nullification")
    card.skillName = skill.name
    card:addSubcard(cards[1])
    return card
  end,
  enabled_at_response = function (self, player, response)
    return not response
  end,
  before_use = function (self, player, use)
    player:broadcastSkillInvoke("lvshi__yanzheng")
  end
})

skill:addEffect("maxcards", {
  exclude_from = function(self, player, card)
    return player:hasSkill(skill.name) and card.type == Card.TypeEquip
  end,
})

return skill